<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button id='btn'>全屏按钮</button>
		<div id="content" style="background:yellow;width:500px;height:500px;">sljfsdlfj
			<div id="quite" class="btn">退出全屏</div>
		</div>
	</body>
</html>
<script type="text/javascript">
	alert(document.body.clientWidth); //网页可见区域宽(body)

	alert(document.body.clientHeight); //网页可见区域高(body)

	alert(document.body.offsetWidth); //网页可见区域宽(body)，包括border、margin等

	alert(document.body.offsetHeight); //网页可见区域宽(body)，包括border、margin等

	alert(document.body.scrollWidth); //网页正文全文宽，包括有滚动条时的未见区域

	alert(document.body.scrollHeight); //网页正文全文高，包括有滚动条时的未见区域

	alert(document.body.scrollTop); //网页被卷去的Top(滚动条)

	alert(document.body.scrollLeft); //网页被卷去的Left(滚动条)

	alert(window.screenTop); //浏览器距离Top

	alert(window.screenLeft); //浏览器距离Left

	alert(window.screen.height); //屏幕分辨率的高

	alert(window.screen.width); //屏幕分辨率的宽

	alert(window.screen.availHeight); //屏幕可用工作区的高

	alert(window.screen.availWidth); //屏幕可用工作区的宽


    alert($(window).height()); //浏览器当前窗口可视区域高度

	alert($(document).height()); //浏览器当前窗口文档的高度

	alert($(document.body).height()); //浏览器当前窗口文档body的高度

	alert($(document.body).outerHeight(true)); //浏览器当前窗口文档body的总高度 包括border padding margin

	alert($(window).width()); //浏览器当前窗口可视区域宽度

	alert($(document).width()); //浏览器当前窗口文档对象宽度

	alert($(document.body).width()); //浏览器当前窗口文档body的宽度

	alert($(document.body).outerWidth(true)); //浏览器当前窗口文档body的总宽度 包括border padding margin
	var btn = document.getElementById('btn');
	var content = document.getElementById('content');
	btn.onclick = function() {
		fullScreen(content);
	}
	var quite = document.getElementById('quite');
	quite.onclick = function() {
		exitFullScreen();
	}

	function fullScreen(el) {
		var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen,
			wscript;

		if (typeof rfs != "undefined" && rfs) {
			rfs.call(el);
			return;
		}

		if (typeof window.ActiveXObject != "undefined") {
			wscript = new ActiveXObject("WScript.Shell");
			if (wscript) {
				wscript.SendKeys("{F11}");
			}
		}
	}

	function exitFullScreen(el) {
		var el = document,
			cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.mozCancelFullScreen || el.exitFullScreen,
			wscript;

		if (typeof cfs != "undefined" && cfs) {
			cfs.call(el);
			return;
		}

		if (typeof window.ActiveXObject != "undefined") {
			wscript = new ActiveXObject("WScript.Shell");
			if (wscript != null) {
				wscript.SendKeys("{F11}");
			}
		}
	}
</script>
